The Particle Group holds all particle subgroups and manages them.
FXParticle* GetParticle (long index, ParticleFactoryTypes subgroup)
Returns
FXParticle with the given index in the given subgroup. Returns nullptr if particle does not exist.
Parameters
long index:
The particle index. Should be between 0 and GetParticleCount
ParticleFactoryTypes subgroup:
The subgroup type to retrieve the particle from
FXParticle* AddParticle (ParticleFactoryTypes subgroup)
Returns
FXParticle that has been added. Returns nullptr if something went wrong.
Parameters
ParticleFactoryTypes subgroup:
The subgroup type to add the particle to
long GetParticleCount (ParticleFactoryTypes subgroup)
Returns
The amount of particles available in the subgroup
Parameters
ParticleFactoryTypes subgroup:
The subgroup type to check the particle count for
void UpdateBounds (void)
Whenever you change a particle group (for example if you change a position of a particle or if you add a particle) you should call UpdateBounds.
void FindNeighbors (const ParticleFactoryTypes subgroup, const vector3d& global_position, const double radius, std::vector& neighbors, const int cpu = 0)
Returns
none
Parameters
const ParticleFactoryTypes:
The subgroup type
const vector3d& global_position:
The physical positon to find particle neighbors for
const double radius:
The maximum distance around the physical position to search for neighboring particles. The radius is given in physical space units.
std::vector
Filled with the found neighboring particles
const int cpu:
The cpu thread for the search. Pass if you are in a multiprocessor context.
void SetDirtySearch (const ParticleFactoryTypes subgroup)
If you change particles' position in the given subgroup of this particle group you should update
the internal search algorithm by calling SetDirtySearch
Parameters
const ParticleFactoryTypes:
The subgroup type to update the searcher for.
bool IsCached (const ParticleFactoryTypes subgroup)
Returns
true if the given subgroup is cached. This is not the same as FXBase::IsCached.
Parameters
const ParticleFactoryTypes:
The subgroup type to check the cached state for.